home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-05-18 | 3.6 KB | 126 lines | [TEXT/CWIE] |
- //
- // qd3d_support.h
- //
-
- #ifndef QD3D_SUP
- #define QD3D_SUP
-
-
-
- #include <QD3D.h>
- #include <QD3DCamera.h>
- #include <QD3DDrawContext.h>
- #include <QD3DRenderer.h>
- #include <QD3DShader.h>
- #include <QD3DStyle.h>
- #include <QD3DView.h>
-
-
- #define DEFAULT_FPS .001
-
- #define MAX_FILL_LIGHTS 4
-
- typedef struct
- {
- WindowPtr displayWindow;
- TQ3ObjectType rendererType;
- TQ3ColorARGB clearColor;
- Rect paneClip; // not pane size, but clip: left = amount to clip off left
- }QD3DViewDefType;
-
-
- typedef struct
- {
- TQ3InterpolationStyle interpolation;
- TQ3BackfacingStyle backfacing;
- TQ3FillStyle fill;
- TQ3ObjectType illuminationType;
- }QD3DStyleDefType;
-
-
- typedef struct
- {
- TQ3Point3D from;
- TQ3Point3D to;
- TQ3Vector3D up;
- float hither;
- float yon;
- float fov;
- }QD3DCameraDefType;
-
- typedef struct
- {
- float ambientBrightness;
- TQ3ColorRGB ambientColor;
- long numFillLights;
- TQ3Vector3D fillDirection[MAX_FILL_LIGHTS];
- TQ3ColorRGB fillColor[MAX_FILL_LIGHTS];
- float fillBrightness[MAX_FILL_LIGHTS];
- }QD3DLightDefType;
-
-
- /* QD3DSetupInputType */
-
- typedef struct
- {
- QD3DViewDefType view;
- QD3DStyleDefType styles;
- QD3DCameraDefType camera;
- QD3DLightDefType lights;
- }QD3DSetupInputType;
-
-
- /* QD3DSetupOutputType */
-
- typedef struct
- {
- TQ3ViewObject viewObject;
- TQ3ShaderObject shaderObject;
- TQ3StyleObject interpolationStyle;
- TQ3StyleObject backfacingStyle;
- TQ3StyleObject fillStyle;
- TQ3CameraObject cameraObject; // another ref is in viewObject, this one's just for convenience!
- TQ3GroupObject lightGroup; // another ref is in viewObject, this one's just for convenience!
- TQ3DrawContextObject drawContext; // another ref is in viewObject, this one's just for convenience!
- WindowPtr window;
- Rect paneClip; // not pane size, but clip: left = amount to clip off left
- }QD3DSetupOutputType;
-
-
- //===========================================================
-
- extern void QD3D_SetupWindow(QD3DSetupInputType *setupDefPtr, QD3DSetupOutputType *outputPtr);
- extern void QD3D_DisposeWindowSetup(QD3DSetupOutputType *data);
- extern void QD3D_ChangeDrawSize(QD3DSetupOutputType *setupInfo);
- extern void QD3D_DrawScene(QD3DSetupOutputType *setupInfo, void (*drawRoutine)(QD3DSetupOutputType *));
- extern void QD3D_UpdateCameraFrom(QD3DSetupOutputType *setupInfo, TQ3Point3D *from);
- extern void QD3D_MoveCameraFrom(QD3DSetupOutputType *setupInfo, TQ3Vector3D *moveVector);
- extern float QD3D_CalcFramesPerSecond(void);
- extern void QD3D_ChangeTextureMap(TQ3ShaderObject textureShader,long rezID);
- extern TQ3SurfaceShaderObject QD3D_GetTextureMap(long textureRezID);
- extern TQ3SurfaceShaderObject QD3D_PICTToTexture(PicHandle picture);
- extern TQ3SurfaceShaderObject QD3D_GWorldToTexture(GWorldPtr theGWorld);
- extern void SetBackFaceStyle(QD3DSetupOutputType *setupInfo, TQ3BackfacingStyle style);
- extern void SetFillStyle(QD3DSetupOutputType *setupInfo, TQ3FillStyle style);
- extern TQ3GroupPosition QD3D_ReplaceObjectInGroup(TQ3Object theGroup, TQ3GroupPosition position, TQ3Object newObj);
- extern TQ3AttributeSet QD3D_MakeDuplicateAttributeSet(TQ3AttributeSet sourceSet);
- extern GWorldPtr QD3D_PixmapToGWorld(TQ3StoragePixmap *pixmap, Rect *r);
- extern Boolean QD3D_ShowError(Str255 errString, Boolean showWarnings);
- extern GWorldPtr QD3D_MipmapToGWorld(TQ3Mipmap *mipmap, Rect *r);
-
- extern void QD3D_ShowRecentError(void);
- extern void QD3D_DoMemoryError(void);
-
- extern void QD3D_UpdateCameraFromTo(QD3DSetupOutputType *setupInfo, TQ3Point3D *from, TQ3Point3D *to);
- extern void QD3D_UpdateCameraFrom(QD3DSetupOutputType *setupInfo, TQ3Point3D *from);
- extern void QD3D_MoveCameraFrom(QD3DSetupOutputType *setupInfo, TQ3Vector3D *moveVector);
-
-
-
-
- #endif
-
-
-
-
-